home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form frmMain
- Caption = "Asynchronous Execution Example"
- ClientHeight = 3180
- ClientLeft = 60
- ClientTop = 345
- ClientWidth = 3720
- Icon = "frmMain.frx":0000
- LinkTopic = "Form1"
- ScaleHeight = 3180
- ScaleWidth = 3720
- StartUpPosition = 3 'Windows Default
- Begin VB.CommandButton cmdCancel
- Caption = "Cancel"
- Height = 315
- Left = 2700
- TabIndex = 2
- Top = 2640
- Width = 735
- End
- Begin VB.CommandButton cmdStart
- Caption = "Start"
- Height = 315
- Left = 1860
- TabIndex = 0
- Top = 2640
- Width = 735
- End
- Begin VB.Label lblmisc
- Caption = "The status label below will indicate the current status of the async object (Started, Completed, Canceled)"
- Height = 615
- Index = 3
- Left = 120
- TabIndex = 6
- Top = 1920
- Width = 3465
- End
- Begin VB.Label lblmisc
- Caption = "You may cancel the asynchronous object from this application by clicking the cancel button."
- Height = 435
- Index = 2
- Left = 120
- TabIndex = 5
- Top = 1320
- Width = 3465
- End
- Begin VB.Label lblmisc
- Caption = "To test the application, click the start button, which starts the asynchronous object then returns control to this application."
- Height = 615
- Index = 0
- Left = 120
- TabIndex = 4
- Top = 540
- Width = 3450
- End
- Begin VB.Label lblmisc
- AutoSize = -1 'True
- Caption = "This is your main application. "
- Height = 195
- Index = 1
- Left = 120
- TabIndex = 3
- Top = 180
- Width = 2070
- End
- Begin VB.Label lblStat
- BackStyle = 0 'Transparent
- Caption = "Status:"
- Height = 255
- Left = 120
- TabIndex = 1
- Top = 2700
- Width = 1635
- End
- Attribute VB_Name = "frmMain"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- Dim tmpObj As TimeObj
- Attribute tmpObj.VB_VarHelpID = -1
- Public Sub CallBack()
- If tmpObj.Canceled Then
- lblStat.Caption = "Status: Canceled"
- Else
- lblStat.Caption = "Status: Complete"
- End If
- cmdStart.Enabled = True
- cmdCancel.Enabled = False
- End Sub
- Private Sub cmdStart_Click()
- lblStat.Caption = "Status: Started"
- cmdStart.Enabled = False
- cmdCancel.Enabled = True
- tmpObj.StartApp Me
- End Sub
- Private Sub cmdCancel_Click()
- tmpObj.StopApp
- End Sub
- Private Sub Form_Load()
- Set tmpObj = New TimeObj
- End Sub
- Private Sub Form_Unload(Cancel As Integer)
- Set tmpObj = Nothing
- End Sub
-